﻿$(function () {
    $("#u4_img").click(function () {
        var userCode = $("#usercode").val();
        var userpassword = $("#userpassword").val();

        $.ajax({  //--------------登录
            url:"login",
            data:"usercode="+userCode+"&userpassword="+userpassword,
            type:"get",
            dataType:"text",
            success:function(result){
                if(result === "true"){
                    location.href="/agentManagement";
                    userss = result;
                }else if(result === "false"){
                    $.messager.show({
                        title: '操作提示',
                        msg: '登录名或密码错误！',
                        timeout: 2000,
                        showType: 'slide'
                    });
                }
            },
            error:function(){
                $.messager.show({
                    title: '操作提示',
                    msg: '出错了！',
                    timeout: 2000,
                    showType: 'slide'
                });
            }
        })
    })

});
